<?php

/**
 * 自定义页面模块
 * @author lan7
 * @copyright lan7.net
 * @version 2.0
 */
if(!defined('IN_ORA')) {
	exit('Access Denied');
}
class page extends mod {
	function v(){
		$id = $GLOBALS['_param']['id'];
		if(!$this->isCached("page-v-id_$id")){
			/** 站点信息 **/
			$this->assign('sinfo',$this->db->getOne('select * from '.tn('info').' order by Id asc limit 1'));
			/** 导航信息 **/
			$this->assign('navs',$this->db->getAll('select * from '.tn('nav').' order by nav_sort desc'));

			/** 产品分类 **/
			import("lib.cat");
			$this->assign('cates',cat_lib::getSubChild(0,2,' and cat_type=1'));
			$sql = "select ops.*,op.content from ".tn('pages')." ops left join ".tn('page')." op on op.pid = ops.Id where ops.Id=$id";
			$info = $this->db->getOne($sql);
			if(!$info){
				redirect("index-index|true");
			}
			$this->assign('info',$info);
			/** 当前位置 **/
			$local = array();
			$local[] = array('url'=>parse_uri('opage-v-id-%d',$info['Id']),'text'=>$info['name']);
			$this->assign('local',$local);
			$this->assign('title',array_reverse($local));
		}
		$this->display("page.html");
	}
}

?>